<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>广告竞价渠道</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="./css/style.css">
    <style>
        input[type='text'][disabled] {
            background-color: #eee!important;
            border: none;
            color: black;
        }
    </style>
</head>

<body>
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">渠道管理</a>
        <a>
          <cite>广告竞价渠道</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>

<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <input type="text" name="username" placeholder="输入电商平台或类目查询" autocomplete="off" class="layui-input">
            <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>

    </div>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('新增广告竞价渠道','./gg-add.html',600,260)"><i class="layui-icon"></i>新增渠道
        </button>
        <span class="x-right" style="line-height:40px">
            <button class="layui-btn  layui-btn-normal layui-btn-small  layui-btn-radius save">保存</button>
            共有数据：88 条</span>
        <div class="clear"></div>
    </xblock>


    <table class="layui-table" lay-filter="demo">
        <thead>
        <tr>

            <th>投放平台</th>
            <th>广告数</th>
            <th>累计资源</th>
            <th>有效资源</th>
            <th>最近资源推送时间</th>
            <th>负责人</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>SEM</td>
            <td class="sl"><input type="text" class="layui-input" placeholder="请输入" disabled="disabled" value="231">
            </td>
            <td>10</td>
            <td>49</td>
            <td>2017-01-20</td>
            <td>马蓉</td>

            <td class="td-manage">
                <a title="编辑" onclick="x_admin_show('修改渠道信息','./gg-add.html',600,260)">
                    <i class="layui-icon">&#xe642;</i>
                </a>
                <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                    <i class="layui-icon">&#xe640;</i>
                </a>
            </td>
        </tr>
        <tr>
            <td>SEM</td>
            <td class="sl"><input type="text" class="layui-input" placeholder="请输入" disabled="disabled" value="231">
            </td>
            <td>10</td>
            <td>49</td>
            <td>2017-01-20</td>
            <td>马蓉</td>

            <td class="td-manage">
                <a title="编辑" onclick="x_admin_show('修改渠道信息','./gg-add.html',600,260)">
                    <i class="layui-icon">&#xe642;</i>
                </a>
                <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                    <i class="layui-icon">&#xe640;</i>
                </a>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="page">
        <div>
            <a class="prev" href="">&lt;&lt;</a>
            <a class="num" href="">1</a>
            <span class="current">2</span>
            <a class="num" href="">3</a>
            <a class="num" href="">99</a>
            <a class="next" href="">&gt;&gt;</a>
        </div>
    </div>
</div>

<script type="text/javascript" src="./js/jquery-3.2.1.min.js"></script>
<script src="./lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
<script>
    //    $(".sl").click(function() {
    //      var input = "<input type='text' id='temp' class=\"layui-input\"  placeholder=\"请输入\" value=" + $(this).text() + " >";
    //      $(this).text("");
    //      $(this).append(input);
    //      $("input#temp").focus();
    //      $("input").blur(function() {
    //        if ($(this).val() == "" || $("this").val() == "请输入") {
    //          $("sl").text("请输入");
    //          //              $("this").closest("td").text("请输入")
    //        } else {
    //          $(this).closest("td").text($(this).val());
    //        }
    //      });
    //    })
    $(".sl").click(function () { //点击单元格输入
        $(this).children("input").removeAttr("disabled");
    })
    $(".save").click(function () {
        $(".sl input").attr("disabled", "disabled");
        layer.msg('已保存!', {
            icon: 1,
            time: 2000
        });
    })
</script>
<script>
    function member_del(obj, id) {
        var data = $(obj).parent().parent().children().html();
        console.log(data)
        layer.confirm('确认要删除' + data + '吗？', {
            title: '确认删除'
        }, function (index) {
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {
                icon: 1,
                time: 1000
            });
        });
    }
</script>
<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>

</html>
